{extend name="template/base" /}
{block name="style"}
<!--select2样式 start -->
<link href="__LIB__/select2-4.0.3/dist/css/select2.min.css" rel="stylesheet" />
<!--select2样式 end -->
{/block}
{block name="content"}
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
        <input type="hidden" name="id" value="{$group.id ?? ''}">
        <!--司机的用户id-->
        <input type="hidden" name="driver_user_id" value="{$driver.id ?? ''}">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">分组：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <?php echo $group['id'];?>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">标题：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <?php echo $group['title'];?>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
        <label class="form-label col-xs-3 col-sm-3">人数：</label>
        <div class="formControls col-xs-6 col-sm-6">
            <?php echo $group['num'];?>
        </div>
        <div class="col-xs-3 col-sm-3"></div>
    </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">司机用户名：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <?php echo $driver['realname'];?>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">司机手机号码：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <?php echo $driver['mobile'];?>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">司机是否确认：</label>
            <div class="formControls col-xs-6 col-sm-6">
                {switch name="$group.driver_confirm"}
                    {case value="1"}已确认{/case}
                    {case value="0"}未确认{/case}
                {/switch}
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">分组状态：</label>
            <div class="formControls col-xs-6 col-sm-6">
                {switch name="$group.dispatch_group_status"}
                    {case value="sendorders"}已派单{/case}
                    {case value="accounts"}已结算{/case}
                    {case value="achieve"}已完成{/case}
                    {case value="undistributed"}未分配{/case}
                    {case value="proceed"}进行中{/case}
                {/switch}
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">出发时间：</label>
            <div class="formControls col-xs-6 col-sm-6">
                {if !empty($group['go_date'])}
                {$group.go_date|date='Y-m-d H:i:s',###}
                {else /}
                    暂无开始日期
                {/if}
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">结束时间：</label>
            <div class="formControls col-xs-6 col-sm-6">
                {if !empty($group['end_date'])}
                    {$group.end_date|date='Y-m-d H:i:s',###}
                {else /}
                    暂无结束日期
                {/if}
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">拒单原因：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <textarea name="rejection_reason" cols="" rows="" class="textarea"  placeholder="请输入不小于10个字的拒单的原因" nullmsg="备注不能为空！"></textarea>
                <p class="textarea-numberbar"></p>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <div id="content"></div>
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}

<script id="td" type="text/html">
              <tr class="text-c">
                <td><input type="hidden" name="traveler[id][]" value="<%=id%>"><%=id%></td>
                  <td><%=oid%></td>
                <td><%=name%></td>
                <td><%=phone%></td>
                <td><%=id_card%></td>
                <td><%=adress%></td>
                <td class="f-14">
                <a href="javascript:" class="label label-success radius op-add" data-type="form" onclick="deltd(this)" data-header="1">删除</a>
                </td>
            </tr>
 </script>

<!--时间插件-->
<script type="text/javascript" src="__LIB__/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="__LIB__/template/template.js"></script>
<!--select2 js 插件-->
<script type="text/javascript" src="__LIB__/select2-4.0.3/dist/js/select2.min.js"></script>
<script>
    function add(){
        var in_undistributed={$vo['dispatch_group_status']=='undistributed'?1:0};
        var is_new={$vo?0:1};
        if(!in_undistributed&&!is_new){
            layer.msg("该状态下不可更改", {
                time: 2000, //2s后自动关闭
            });
            return ;
        }

        var index=layer.open({
            type: 2,
            area: ['700px', '450px'],
            fixed: false, //不固定
            maxmin: true,
            content: '/admin/dispatch_traveler_group/traveler?'+$("input[name='traveler[id][]']").serialize()
        });
        layer.full(index);
    }
    function deltd(ele){
        var in_undistributed={$vo['dispatch_group_status']=='undistributed'?1:0};
        var is_new={$vo?0:1};
        if(!in_undistributed&&!is_new){
            layer.msg("该状态下不可更改", {
                time: 2000, //2s后自动关闭
            });
            return ;
        }
        $(ele).parent().parent().remove();
    }

    $(function () {

        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        //车型select2 js部分 start
        var car_type_id = $("#car_type_id").select2({
            language: "zh-CN", //设置 提示语言
            width: "100%", //设置下拉框的宽度
            theme: "classic"
        });
        {notempty name = "vo['car_type_id']"}
        car_type_id.val("{$vo['car_type_id']}").trigger("change");
        {/notempty}
            //车型select2 js部分 end

        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret){
                ajax_progress(ret);
            }
        });
    })
</script>
{/block}
